<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Script::StringInterpolation</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (S)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Script.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script.html" title="Sass::Script (module)">Script</a></span>
     &raquo; 
    <span class="title">StringInterpolation</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Script/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Script/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Script::StringInterpolation 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></li>
          
            <li class="next">Sass::Script::StringInterpolation</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A SassScript object representing <code>#{}</code> interpolation within a string.</p>

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Interpolation.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Interpolation.html" title="Sass::Script::Interpolation (class)">Interpolation</a></li>
    
  </ul>

</div>

  
  
  
  

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#_perform-instance_method" title="#_perform (instance method)">- (Sass::Script::String) <strong>_perform</strong>(environment) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Evaluates the interpolation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#children-instance_method" title="#children (instance method)">- (Array&lt;Node&gt;) <strong>children</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the three components of the interpolation, <code>before</code>, <code>mid</code>, and <code>after</code>.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#deep_copy-instance_method" title="#deep_copy (instance method)">- <strong>deep_copy</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (StringInterpolation) <strong>initialize</strong>(before, mid, after) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">Interpolation in a string is of the form <code>&quot;before #{mid} after&quot;</code>, where <code>before</code> and <code>after</code> may include more interpolation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#inspect-instance_method" title="#inspect (instance method)">- (String) <strong>inspect</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">A human-readable s-expression representation of the interpolation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_sass-instance_method" title="#to_sass (instance method)">- <strong>to_sass</strong>(opts = {}) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></h3>
  <p class="inherited"><a href="Node-1.html#dasherize-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#dasherize-instance_method" title="Sass::Script::Node#dasherize (method)">#dasherize</a>, <a href="Node-1.html#opts-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#opts-instance_method" title="Sass::Script::Node#opts (method)">#opts</a>, <a href="Node-1.html#perform-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#perform-instance_method" title="Sass::Script::Node#perform (method)">#perform</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Script::StringInterpolation (class)">StringInterpolation</a></tt>) <strong>initialize</strong>(before, mid, after) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Interpolation in a string is of the form <code>&quot;before #{mid} after&quot;</code>, where <code>before</code> and <code>after</code> may include more interpolation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></tt>)</span>
      
      
        <span class='name'>before</span>
      
      
      
        &mdash;
        The string before the interpolation
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></tt>)</span>
      
      
        <span class='name'>mid</span>
      
      
      
        &mdash;
        The SassScript within the interpolation
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></tt>)</span>
      
      
        <span class='name'>after</span>
      
      
      
        &mdash;
        The string after the interpolation
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


12
13
14
15
16</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 12</span>

def initialize(before, mid, after)
  @before = before
  @mid = mid
  @after = after
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="_perform-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">Sass::Script::String</a></tt>) <strong>_perform</strong>(environment)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Evaluates the interpolation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Environment.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Environment.html" title="Sass::Environment (class)">Sass::Environment</a></tt>)</span>
      
      
        <span class='name'>environment</span>
      
      
      
        &mdash;
        The environment in which to evaluate the SassScript
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">Sass::Script::String</a></tt>)</span>
      
      
      
      
        &mdash;
        The SassScript string that is the value of the interpolation
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


78
79
80
81
82
83
84
85
86</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 78</span>

def _perform(environment)
  res = ""
  before = @before.perform(environment)
  res << before.value
  mid = @mid.perform(environment)
  res << (mid.is_a?(Sass::Script::String) ? mid.value : mid.to_s)
  res << @after.perform(environment).value
  opts(Sass::Script::String.new(res, before.type))
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="children-instance_method">
  
    - (<tt>Array&lt;<a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a>&gt;</tt>) <strong>children</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the three components of the interpolation, <code>before</code>, <code>mid</code>, and <code>after</code>.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#initialize-instance_method" title="Sass::Script::StringInterpolation#initialize (method)">#initialize</a></li>
    
      <li><a href="Node-1.html#children-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#children-instance_method" title="Sass::Script::Node#children (method)">Node#children</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 59</span>

def children
  [@before, @mid, @after].compact
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="deep_copy-instance_method">
  
    - <strong>deep_copy</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Node-1.html#deep_copy-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#deep_copy-instance_method" title="Sass::Script::Node#deep_copy (method)">Node#deep_copy</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67
68
69
70</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 64</span>

def deep_copy
  node = dup
  node.instance_variable_set('@before', @before.deep_copy) if @before
  node.instance_variable_set('@mid', @mid.deep_copy)
  node.instance_variable_set('@after', @after.deep_copy) if @after
  node
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="inspect-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>inspect</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A human-readable s-expression representation of the interpolation</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        A human-readable s-expression representation of the interpolation
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 19</span>

def inspect
  "(string_interpolation #{@before.inspect} #{@mid.inspect} #{@after.inspect})"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_sass-instance_method">
  
    - <strong>to_sass</strong>(opts = {}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Node-1.html#to_sass-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#to_sass-instance_method" title="Sass::Script::Node#to_sass (method)">Node#to_sass</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/string_interpolation.rb', line 24</span>

def to_sass(opts = {})
  # We can get rid of all of this when we remove the deprecated :equals context
  # XXX CE: It's gone now but I'm not sure what can be removed now.
  before_unquote, before_quote_char, before_str = parse_str(@before.to_sass(opts))
  after_unquote, after_quote_char, after_str = parse_str(@after.to_sass(opts))
  unquote = before_unquote || after_unquote ||
    (before_quote_char && !after_quote_char && !after_str.empty?) ||
    (!before_quote_char && after_quote_char && !before_str.empty?)
  quote_char =
    if before_quote_char && after_quote_char && before_quote_char != after_quote_char
      before_str.gsub!("\\'", "'")
      before_str.gsub!('"', "\\\"")
      after_str.gsub!("\\'", "'")
      after_str.gsub!('"', "\\\"")
      '"'
    else
      before_quote_char || after_quote_char
    end

  res = ""
  res << 'unquote(' if unquote
  res << quote_char if quote_char
  res << before_str
  res << '#{' << @mid.to_sass(opts) << '}'
  res << after_str
  res << quote_char if quote_char
  res << ')' if unquote
  res
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:41 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>